package cn.geminis.data.jpa.repository;

import cn.geminis.data.jpa.entity.Book;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface BookRepository extends
        JpaRepository<Book, String>,
        JpaSpecificationExecutor<Book> {

    @EntityGraph(value = "book.student", type = EntityGraph.EntityGraphType.FETCH)
    List<Book> findAllByName(String name);

}
